//
//  BaseViewController.m
//  WisdomZhuHai
//
//  Created by yewei on 13-9-4.
//  Copyright (c) 2013年 wyd. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController
@synthesize frame;

-(id)initWithFrame:(CGRect)f
{
    self.frame = f;
    self = [super init];
    if(self)
    {
        
    }
    return self;
}

-(void)dealloc
{
    [super dealloc];
}

-(void)loadView
{
    self.view = [[[UIView alloc]initWithFrame:self.frame]autorelease];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1
    if([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
    {
        [self setEdgesForExtendedLayout:UIRectEdgeLeft | UIRectEdgeRight];
    }
#endif
    NSString* backName = @"";
    if ([Common getIosVersion] < 7.0) {
        backName = NSLocalizedString(@"Back", nil);
    }
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:backName style:UIBarButtonItemStyleBordered target:nil action:nil];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.


}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {    return  UIInterfaceOrientationIsPortrait( interfaceOrientation );
}

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
    // return UIInterfaceOrientationMaskAllButUpsideDown;
    return UIInterfaceOrientationMaskPortrait;
#endif
}

- (BOOL) shouldAutorotate {
    return NO;
}

@end
